<?php //pr($this->data) ?>
<?php //pr($this->params) ?>
<?php echo $form->create('fotos', array('url'=>$this->here, 'type'=>'file', 'id'=>'uploadForm')) ?>
<ul>
	<li> <?php echo $form->file('file0') ?> </li>
	<li> <?php echo $form->input('alt', array('div'=>false, 'label'=>__('description', true))) ?> </li>
	<li> <?php echo $form->submit(__('upload', true), array('div'=>false)) ?> </li>
</ul>
<?php echo $form->end() ?>


<?php if (!empty($fotos)): ?>
<ul id="fotosList">
	<?php $af = 0 ?>
	<?php foreach ($fotos as $k => $v): ?>
	<?php $hash = $v['Foto']['hash'] ?>	
	<li class="<?php echo key($v) ?>">
		<a href="/fotos/edit/<?php echo $hash ?>" title="<?php echo $v['Foto']['alt'] ?>">
			<img id="foto<?php echo $af ?>" src="<?php echo $v['Fotopreview']['path'] ?>" alt="<?php echo $v['Foto']['alt'] ?>" />
		</a>
		<a class="delete" href="/fotos/delete/<?php echo $hash ?>"><?php echo __('delete', true) ?></a>
		<?php if ($af): ?>
		<a class="delete" href="/fotos/mainfoto/<?php echo $hash ?>">как аватар</a>
		<?php endif ?>
	</li>
	<?php $af++ ?>
	<?php endforeach ?>
</ul>
<?php endif; ?>
